package skills.jssvc.deu.cn.skillsecond.util;

import android.graphics.Bitmap;
import android.widget.ImageView;

import com.android.volley.Response;
import com.android.volley.toolbox.ImageRequest;
import com.android.volley.toolbox.JsonObjectRequest;
import org.json.JSONObject;

import skills.jssvc.deu.cn.skillsecond.MyApplication;

/**
 * Created by Administrator on 2019/3/11 0011.
 */

public class HttpRequest {
    public static void post(String name, String parma, Response.Listener<JSONObject>listener, Response.ErrorListener errorListener){
        String url="http://192.168.0.106:8088/transportservice/action/"+name+".do";
        JsonObjectRequest request = new JsonObjectRequest(1,url,parma,listener,errorListener);
        MyApplication.queue.add(request);
    }

    public static void getBitmap(String name, Response.Listener<Bitmap>listener, Response.ErrorListener errorListener){
        String url = "http://192.168.0.106:8088/transportservice"+name;
        ImageRequest request=new ImageRequest(url,listener,0,0, ImageView.ScaleType.FIT_XY, Bitmap.Config.ARGB_8888,errorListener);
        MyApplication.queue.add(request);
    }

}
